package com.ljy.mapper;

import com.ljy.entity.Specification;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SpecMapper {

    void insertSpec(List<Specification> specs, Integer goodsId);

    @Select("select id, name, price, stock, goods_id, sales_volume from specification " +
            "where goods_id=#{goodsId}")
    List<Specification> selectByGoodsId(Integer goodsId);

    @Delete("delete from specification where goods_id=#{goodsId}")
    void deleteByGoodsId(Integer goodsId);

    void batchDelete(List<Integer> ids);
}
